/**
 * 基础存储类
 * 定义所有存储类型的通用接口
 */
export class BaseStorage {
  constructor(type) {
    this.type = type;
  }

  /**
   * 设置数据
   * @param {string} key - 键名
   * @param {any} value - 值
   * @param {Object} options - 选项
   * @returns {boolean|Promise<boolean>} 是否成功
   */
  set(key, value, options = {}) {
    throw new Error('set method must be implemented');
  }

  /**
   * 获取数据
   * @param {string} key - 键名
   * @param {Object} options - 选项
   * @returns {any|Promise<any>} 值
   */
  get(key, options = {}) {
    throw new Error('get method must be implemented');
  }

  /**
   * 删除数据
   * @param {string} key - 键名
   * @param {Object} options - 选项
   * @returns {boolean|Promise<boolean>} 是否成功
   */
  remove(key, options = {}) {
    throw new Error('remove method must be implemented');
  }

  /**
   * 清空存储
   * @param {Object} options - 选项
   * @returns {boolean|Promise<boolean>} 是否成功
   */
  clear(options = {}) {
    throw new Error('clear method must be implemented');
  }

  /**
   * 获取所有键
   * @param {Object} options - 选项
   * @returns {string[]|Promise<string[]>} 键数组
   */
  keys(options = {}) {
    throw new Error('keys method must be implemented');
  }

  /**
   * 检查存储是否可用
   * @returns {boolean} 是否可用
   */
  isAvailable() {
    throw new Error('isAvailable method must be implemented');
  }
}
